<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/head"></head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <th:block th:replace="common/header"></th:block>
    <th:block th:replace="common/nav"></th:block>
 <style>
     table td{
         max-width: 40px;
         word-wrap: break-word;
         text-overflow: ellipsis;
         white-space: nowrap;
         overflow: hidden;
     }

     table td:hover{
         white-space: normal;
         overflow: auto;
     }
 </style>
    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                游戏类目管理
                <small>游戏类目管理</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="/index"><i class="fa fa-dashboard"></i> 首页</a></li>
                <li><a href="#">游戏类目管理</a></li>
            </ol>
        </section>

        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title hidden-xs">游戏类目列表</h3>
                            <br/>
                            <div class="box-tools">
                                <form action="list" method="get" id="searchForm">
                                    <input type="hidden" id="nowpage" name="nowpage" value="1" />

                                    <div class="input-group" style="width: 250px;">
                                        <!--/*@thymesVar id="page" type="com.healthtop.common.Page"*/-->
                                        <input type="text" name="keyword" th:value="${page.keyword}" class="form-control input-sm pull-right" placeholder="游戏类目名称/运营商">
                                        <div class="input-group-btn">
                                            <button class="btn btn-sm btn-default" type="submit"><i class="fa fa-search"></i></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <!-- /.box-header -->
                        <div class="mailbox-controls">
                            <!-- Check all button -->
                            <a href="/xsGameGategory/forward?mode=0" type="button" class="btn btn-success">新增</a>
                            <!-- <a href="/account/updateAllPassword" class="btn btn-danger" type="button">全部重置密码</a>-->
                        </div>
                        <div class="box-body">
                            <table id="example1" class="table table-bordered table-striped" style='table-layout: fixed'>
                                <thead>
                                <tr>
                                    <th>游戏类目名称</th>
                                    <th>游戏类目运营商</th>
                                    <th>游戏类目介绍</th>
                                    <th>创建时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <!--/*@thymesVar id="page" type="com.healthtop.common.Page"*/-->
                                <th:block th:each="e : ${page.allentities}">
                                    <tr>
                                        <td>
                                            <span th:text="${e.gameName}"></span>
                                        </td>
                                        <td>
                                            <span th:text="${e.gameOperators}"></span>
                                        </td>
                                        <td>
                                            <span th:text="${e.gameInfo}"></span>
                                        </td>
                                        <td>
                                            <span th:text="${e.createTime}"></span>
                                        </td>
                                        <td data-label="操作">
                                            <a th:href="@{/xsGameGategory/forward(mode=1,id=${e.id})}"><button class="btn btn-success">编辑</button></a>
                                            <a th:href="@{/xsGameGategory/forward(mode=2,id=${e.id})}"><button class="btn btn-success">查看</button></a>
                                            <button class="btn btn-danger" th:if="${e.delFalg=='0'}" th:onclick="'javascript:del('+${e.id}+','+${e.delFalg}+')'">停用</button>
                                            <button class="btn btn-danger" th:if="${e.delFalg=='1'}" th:onclick="'javascript:del('+${e.id}+','+${e.delFalg}+')'">启用</button>
                                        </td>
                                    </tr>
                                </th:block>
                                </tbody>
                                <tfoot>
                                <tr>
                                    <th>游戏类目名称</th>
                                    <th>游戏类目运营商</th>
                                    <th>游戏类目介绍</th>
                                    <th>创建时间</th>
                                    <th>操作</th>
                                </tr>
                                </tfoot>
                            </table>
                        </div>
                        <th:block th:replace="common/page"></th:block>
                        <script type="text/javascript">
                            function jumpPage(pageno) {
                                if(pageno<1) {
                                    alert('请输入正整数');
                                } else {
                                    $('#nowpage').val(pageno);
                                    $('#searchForm').submit();
                                }
                            }
                        </script>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
        </section>
    </div>

    <th:block th:replace="common/footer"></th:block>
</div>

<th:block th:replace="common/script"></th:block>
</body>
</html>
<link rel="stylesheet" href="/css/postbirdAlertBox.min.css">
<script src="/js/postbirdAlertBox.min.js"></script>
<script>
    function del(newId,delFalg) {
        var id=newId;
        var delFalg=delFalg;
        var title="删除操作";
        var content="你确定删除该游戏类目信息吗";
        if(delFalg==1){
            delFalg=0;
            title="启用操作";
            content="你确定启用该游戏类目信息吗";
        }else{
            delFalg=1;
        }
        PostbirdAlertBox.confirm({
            'title': title,
            'content': content,
            'okBtn': '确定',
            'contentColor': 'red',
            'onConfirm': function () {
                window.location.href="/xsGameGategory/delete?id="+id+'&delFalg='+delFalg;
            },
            'onCancel': function () {
            }
        });
    }

    function change(newId,status) {
        var id=newId;
        var msg;
        if(status == 0){
            msg = "你确定要发布该新闻吗"
        }else{
            msg = "你确定要取消发布该新闻吗"
        }
        PostbirdAlertBox.confirm({
            'title': '操作',
            'content': msg,
            'okBtn': '确定',
            'contentColor': 'red',
            'onConfirm': function () {
                window.location.href="/news/change?id="+id;
            },
            'onCancel': function () {
            }
        });
    }
</script>